Brooks – Iyengar algorithm